from django.contrib import admin
from mhlandscaping.apps.service.models import Category, Service, ServiceImage

class ServiceImageInline(admin.StackedInline):
    model = ServiceImage
    extra = 0

class CategoryAdmin(admin.ModelAdmin):
    prepopulated_fields = {'slug': ('name', )}
admin.site.register(Category, CategoryAdmin)

class ServiceAdmin(admin.ModelAdmin):
    prepopulated_fields = {'slug': ('name', )}
    inlines = [ServiceImageInline,]
admin.site.register(Service, ServiceAdmin)
